<!DOCTYPE html>
<html lang="en"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:v-bind="http://www.w3.org/1999/xhtml"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <title>Spring_Boot_Thymeleaf</title>
</head>
<body>
<h3>This is thymeleaf test page.</h3>

<p>===========================================</p>
<h3>th:text</h3>
<p th:text="${thymeleafTitle}"></p>
<p>===========================================</p>
<h3>th:if,th:unless.</h3>
<p th:if="${checked} == true">Checked is true</p>
<p th:unless="${checked} == True">Checked is not ture</p>
<p th:if="${currentNumber}&lt;100">Current Number less 100</p>
<p th:if="${thymeleafTitle} == null">Thymeleaf Title is null</p>
<p>===========================================</p>
<h3>th:attr</h3>
<p><input type="checkbox" th:checked="${checked}"></p>
<p><img th:src="${src}"></p>
<p><a th:href="${href}">链接</a></p>
<p><a th:href="@{http://www.baidu.com}">百度</a></p>
<p><a th:href="@{'/test/city/' + ${city.cityId}}">路径参数</a></p>
<p><a th:href="@{/test/city(cityId=${city.cityId},cityName=${city.cityName})}">查询参数</a></p>
<p>===========================================</p>
<h3>th:object</h3>
<div th:object="${city}">
    <p>城市id：<span th:text="*{cityId}"></span></p>
    <p>城市名字：<span th:text="${city.cityName}"></span></p>
</div>
<p>===========================================</p>
<h3>th:each</h3>
<ul th:each="aaa : ${cities}">
    <li th:text="${aaa.cityName}"></li>
</ul>
<table>
    <tr><td>ID</td><td>City Name</td></tr>
    <tr th:each="city : ${cities}">
        <td th:text="${city.cityId}"></td>
        <td th:text="${city.cityName}"></td>
    </tr>
</table>
<select>
    <option th:each="city : ${cities}" th:value="${city.cityId}" th:text="${city.cityName}"></option>
</select>
<p>===========================================</p>
<h3>th:form</h3>
<!-- 有的浏览器并不支持 PUT 请求，SpringMVC 为我们提供了一种解决方案
    全局配置开启 hidden method：spring.mvc.hiddenmethod.filter.enabled=true
    表单中添加 hidden 指定 method
-->
<form action="/api/city" method="post">
    <input type="hidden" name="_method" value="PUT">
    <p>cityId: <input type="text" th:value="${city.cityId}" name="cityId" /></p>
    <p>cityName: <input type="text" th:value="${city.cityName}" name="cityName" /></p>
    <p>localCityName: <input type="text" th:value="${city.localCityName}" name="localCityName"/></p>
    <p><input type="submit" value="Submit" /></p>
</form>



</body>
</html>